from urllib import request


url = "http://www.baidu.com"
response = request.urlopen(url)

print(response.getheaders())

